package com.sky.mapper;



import com.github.pagehelper.Page;
import com.sky.dto.CategoryPageQueryDTO;
import com.sky.entity.Category;
import org.apache.ibatis.annotations.*;

@Mapper
public interface CategoryMapper {

    @Insert("insert into category(type, name, sort, status, create_time, update_time, create_user, update_user)" +
            " VALUES" +
            " (#{type}, #{name}, #{sort}, #{status}, #{createTime}, #{updateTime}, #{createUser}, #{updateUser})")
    void insert(Category category);


    /**
     * 分类分页查询
     * @param categoryPageQueryDTO
     * @return
     */
    Page<Category> query(CategoryPageQueryDTO categoryPageQueryDTO);

    /**
     * 修改分类信息
     * @param category
     */
    void update(Category category);

    @Delete("delete from category where id = #{id}")
    void delete(Integer id);

    void startOrStop(Category category);


    /**
     * 启用和禁用分类
     * @param status
     * @param id
     * @return
     */

    
}
